Optimal. Leaf size=38 \[ -\frac{a^2 \cot (e+f x)}{f}-x (a-b)^2+\frac{b^2 \tan (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06506, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 461, 203} \[ -\frac{a^2 \cot (e+f x)}{f}-x (a-b)^2+\frac{b^2 \tan (e+f x)}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3670
Rule 461
Rule 203
Rubi steps
\begin{align*} \int \cot ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^2}{x^2 \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (b^2+\frac{a^2}{x^2}-\frac{(a-b)^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{a^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f}-\frac{(a-b)^2 \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-(a-b)^2 x-\frac{a^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f}\\ \end{align*}
Mathematica [C] time = 0.102656, size = 66, normalized size = 1.74 \[ -\frac{a^2 \cot (e+f x) \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\tan ^2(e+f x)\right )}{f}+2 a b x-\frac{b^2 \tan ^{-1}(\tan (e+f x))}{f}+\frac{b^2 \tan (e+f x)}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.04, size = 53, normalized size = 1.4 \begin{align*}{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) -fx-e \right ) +2\, \left ( fx+e \right ) ab+{a}^{2} \left ( -\cot \left ( fx+e \right ) -fx-e \right ) }{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.64509, size = 62, normalized size = 1.63 \begin{align*} \frac{b^{2} \tan \left (f x + e\right ) -{\left (a^{2} - 2 \, a b + b^{2}\right )}{\left (f x + e\right )} - \frac{a^{2}}{\tan \left (f x + e\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.04018, size = 115, normalized size = 3.03 \begin{align*} -\frac{{\left (a^{2} - 2 \, a b + b^{2}\right )} f x \tan \left (f x + e\right ) - b^{2} \tan \left (f x + e\right )^{2} + a^{2}}{f \tan \left (f x + e\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 5.50577, size = 73, normalized size = 1.92 \begin{align*} \begin{cases} \tilde{\infty } a^{2} x & \text{for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \cot ^{2}{\left (e \right )} & \text{for}\: f = 0 \\- a^{2} x - \frac{a^{2}}{f \tan{\left (e + f x \right )}} + 2 a b x - b^{2} x + \frac{b^{2} \tan{\left (e + f x \right )}}{f} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.6694, size = 66, normalized size = 1.74 \begin{align*} \frac{b^{2} \tan \left (f x + e\right ) -{\left (a^{2} - 2 \, a b + b^{2}\right )}{\left (f x + e\right )} - \frac{a^{2}}{\tan \left (f x + e\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]